<?php

namespace app\api\model;

class Blacklist extends Common
{
    static public function lists($user_id, $style = false, $status = false)
    {
        $contain1 = self::where(['user_id' => $user_id])->column('to_user');
        $contain2 = self::where(['to_user' => $user_id])->column('user_id');

        $data = array_merge($contain1, $contain2);

        if ($status) {
            $data[] = $user_id;
        }

        $data = array_unique($data);

        if ($style) {
            $data = implode(',', $data);
        }

        return $data;
    }
}
